Drilling, completion, and production of reservoir wells involve measuring various subsurface formation parameters. Companies often measure percentages of oil, water, and gas mixtures contained in representative fluid samples drawn from wells to determine formation fluid quality. The formation fluid quality of a particular well can be used to determine the economic value of extracting fluid from the reservoir well. Generating accurate measurements of formation fluid requires drawing fluid samples substantially free of contaminants from a reservoir well to avoid generating measurements reflective of contaminants introduced into the reservoir well.
Contaminants are often introduced into a well during a drilling process. For example, to facilitate a drilling process, a drilling mud is introduced into the well as a lubricant to reduce the effects of friction between a drill bit and a formation wall of the well. Contamination of formation fluid occurs when the filtrate of the drilling mud permeates the formation wall during and after drilling. When drawing formation fluid samples to measure formation fluid quality, the formation fluid samples often contain a mixture of formation fluid and mud filtrate. The amount of mud filtrate in a formation fluid sample indicates the contamination level (i.e., the amount of contamination) of the formation fluid sample. If the filtrate is miscible with the formation fluid (e.g., when a well penetrating a hydrocarbon-bearing formation is drilled with oil base mud (OBM)), the filtrate contamination in the formation fluid can reduce the quality of formation fluid samples and make subsequent pressure, volume, and temperature (PVT) analysis unreliable or even incorrect.
To obtain a sample containing formation fluid substantially free of contaminants, a fluid extractor (e.g., a pump) in a downhole drillstring or a downhole wireline tool is used to extract or pump fluid from the formation until the extracted fluid is substantially free of contaminants. Known techniques for determining when a sample is substantially free of contaminants involve measuring optical density (OD) (i.e., optical absorbance) of fluid samples using a single channel (i.e., corresponding to a single wavelength) of a spectrometer. For a mixture of formation fluid and mud filtrate, a measured optical density at a particular wavelength (λ) is linearly related to a contamination level. As the contamination levels of drawn samples decrease as pumping time increases, the measured optical density values change to indicate the changing contamination levels. Using these known techniques to measure contamination levels involves using equations and several assumed parameter values determined empirically over time using measured data from various reservoir wells. However, the empirical nature of such parameter values often leads to inefficiencies in well testing. For example, using such parameter values to determine the amount of time to pump in one well before obtaining a formation fluid sample substantially free of contaminants may result in pumping for a relatively longer duration than necessary in that well. On the other hand, using the same parameter values to determine a pumping time for another well may lead to pumping for an insufficient duration, which causes acquiring erroneous measurements of extracted formation fluid samples having relatively high contamination levels.